﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using BCCommon.Enums;
using BCCommon.Extensions;
using System.IO;

namespace BCDto.MakeStaticPagingComponent.PageTemplateAttachment
{
    /// <summary>
    /// 页面模板附件
    /// </summary>
    public class PageTemplateAttachmentDto
    {
        /// <summary>
        /// 页面模板附件Id
        /// </summary>		
        public int PageTemplateAttachmentId { get; set; }
        /// <summary>
        /// 页面模板Id
        /// </summary>		
        public long PageTemplateId { get; set; }
        /// <summary>
        /// 网站模板Id
        /// </summary>		
        public int WebsiteTemplateId { get; set; }
        /// <summary>
        /// 文件类型
        /// </summary>		
        public StaticPageFileType FileType { get; set; }
        /// <summary>
        /// 插入位置
        /// </summary>		
        public StaticPageInsertLocationType InsertLocation { get; set; }
        /// <summary>
        /// 文件类型
        /// </summary>		
        public string FileTypeStr => this.FileType.GetDisplayString();
        /// <summary>
        /// 插入位置
        /// </summary>		
        public string InsertLocationStr => this.InsertLocation.GetDisplayString();
        /// <summary>
        /// 文件地址
        /// </summary>		
        public string FileAddress { get; set; }
        /// <summary>
        /// 文件名称
        /// </summary>		
        public string FileName {
            get
            {
                if (!string.IsNullOrWhiteSpace(this.FileAddress))
                {
                    return Path.GetFileName(this.FileAddress);
                }
                return string.Empty;
            }
        }
        /// <summary>
        /// 创建人Id
        /// </summary>		
        public long CreateAdminId { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>		
        public string CreateAdminName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>		
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>		
        public DateTime UpdateTime { get; set; }
        /// <summary>
        /// 修改人Id
        /// </summary>		
        public long? EditAdminId { get; set; }
        /// <summary>
        /// 修改人
        /// </summary>		
        public string EditAdminName { get; set; }

    }
}

